package com.sztx.pay.center.dataaccess.dao.mysql;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.sztx.pay.center.dataaccess.domain.UserActFlowDO;
import com.sztx.pay.center.dataaccess.domain.UserActFlowDumpDO;
import com.sztx.se.dataaccess.mysql.config.PageQuery;

public interface UserActFlowMysqlDAO  {

	List<UserActFlowDO> listPage(@Param("userActFlowDO") UserActFlowDO query, @Param("pageQuery") PageQuery pageQuery);

//	Integer listCount(UserActFlowDO query);

//	Integer saveDo(UserActFlowDO userActFlowDO);

	Integer listCount(UserActFlowDO userActFlowDO);

	Integer saveBalanceFlow(UserActFlowDO userActFlowDO);

	Integer saveFreezeFlow(UserActFlowDO userActFlowDO);

	List<UserActFlowDO> listPageByTime(@Param("userActFlowDO") UserActFlowDO userActFlowDO, @Param("pageQuery") PageQuery pageQuery,
			@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("inOrOut") Integer inOrOut,
			@Param("businessTypeList") List<String> businessTypeList);

	Integer inAmount(@Param("userActFlowDO") UserActFlowDO userActFlowDO, @Param("startTime") String startTime, @Param("endTime") String endTime,
			@Param("inOrOut") Integer inOrOut, @Param("businessTypeList") List<String> businessTypeList);

	Integer outAmount(@Param("userActFlowDO") UserActFlowDO userActFlowDO, @Param("startTime") String startTime, @Param("endTime") String endTime,
			@Param("inOrOut") Integer inOrOut, @Param("businessTypeList") List<String> businessTypeList);

	Integer listCountByTime(@Param("userActFlowDO") UserActFlowDO userActFlowDO, @Param("startTime") String startTime,
			@Param("endTime") String endTime, @Param("inOrOut") Integer inOrOut, @Param("businessTypeList") List<String> businessTypeList);
	
	List<UserActFlowDumpDO> findUnHandleForSchedule(@Param("taskItemNum") Integer taskItemNum, @Param("taskItems") List<String> taskItems, @Param("fetchNum") Integer fetchNum,
			@Param("startTime") String startTime, @Param("endTime") String endTime);

	int updateHandleForSchedule(@Param("tradeOrderId") String tradeOrderId, @Param("oldStatus") List<Integer> oldStatus, @Param("newStatus") Integer newStatus, @Param("num") Integer num);
	
	void deleteDumpCount(@Param("startTime") String startTime, @Param("endTime") String endTime);

	int batchUpdateHandleForSchedule(@Param("tradeOrderIds") List<String> tradeOrderIds, @Param("oldStatus") List<Integer> oldStatus, @Param("newStatus") Integer newStatus, @Param("num") Integer num);
	
	Integer getActFlowCountByActNo(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("actNo") String actNo);
	
	UserActFlowDO getFirstActFlowByActNo(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("actNo") String actNo);
	
	UserActFlowDO getLastActFlowByActNo(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("actNo") String actNo);
}